package com.mindata.blockchain.block.m;

/**
 * @author wuweifeng wrote on 2018/3/6.
 */
public class Test {
	public static void main(final String[] args) {

		final MerkleTree merkleTree = new MerkleTree();
		final MerkleNode merkleNode0 = new MerkleNode(MerkleHash.create("a"));
		final MerkleNode merkleNode1 = new MerkleNode(MerkleHash.create("b"));
		final MerkleNode merkleNode2 = new MerkleNode(MerkleHash.create("c"));
		final MerkleNode merkleNode3 = new MerkleNode(MerkleHash.create("d"));

		merkleTree.appendLeaf(merkleNode0);
		merkleTree.appendLeaf(merkleNode1);
		merkleTree.appendLeaf(merkleNode2);
		merkleTree.appendLeaf(merkleNode3);
		merkleTree.buildTree();
		System.out.println(merkleTree.getRoot().getHash());
		merkleTree.auditProof(MerkleHash.create("a"));
	}
}
